package cuit.cx.groupcomment.util;

import java.util.Random;

public class GroupComment
{
	
	
	public static synchronized String generateSerial()
	{
		Random random = new Random();
		int r = random.nextInt();
		String r1 = Integer.toHexString(r);
		r1 = getHexString(r1);
		String serialId = "SZ"+r1;
		
		boolean flag = checkSerial(serialId);
		if (flag)
		{
			generateSerial();
		}
		
		return serialId;
	}
	
	
	public static String getHexString(String hexString)
	{
		StringBuffer buffer = new StringBuffer(hexString);
		while (buffer.length() < 8)
		{
			buffer.insert(0, "0");			
		}
		return buffer.toString();
	}
	
	
	public static boolean checkSerial(String serialId)
	{
		return false;
	}

}
